package com.xiong.wuliao.HomeVideo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import com.xiong.wuliao.R;

public class WebPlayerActivity extends AppCompatActivity {

	private WebView myWebViewPlayer;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_web_player);
		init();
	}

	private void init() {
		findView();
		initWebView();
		setListener();
	}

	/**
	 * 设置监听事件
	 */
	private void setListener() {

	}

	// 初始化WebView
	private void initWebView() {
		Intent intent = getIntent();
		String videoUrl = intent.getStringExtra("videoUrl");
		myWebViewPlayer.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
		myWebViewPlayer.getSettings().setJavaScriptEnabled(true);

		myWebViewPlayer.clearView();
		myWebViewPlayer.loadUrl(videoUrl);
		myWebViewPlayer.clearHistory();
	}

	private void findView() {
		myWebViewPlayer = (WebView) findViewById(R.id.myWebViewPlayer);
	}
}
